#!/usr/bin/perl
# split.pl
use warnings;
use strict;

my @words;

# read lines from files specified on command line or (if none) 
# standard input
while (<>) {
   # split lines into words and store
   push @words, split;
}

print "Found ", scalar(@words), " words in input \n";